
#ifndef __OLED_H
#define __OLED_H
			  	 
#include "gpio-driver.h"
#include "spi-driver.h"

#define OLED_MODE 0
#define SIZE 16
 	
//OLED模式设置
//0:4线串行模式
//1:并行8080模式
#define OLED_MODE 0
#define SIZE 16
#define XLevelL		0x00
#define XLevelH		0x10
#define Max_Column	128
#define Max_Row		64
#define	Brightness	0xFF 
#define X_WIDTH 	128
#define Y_WIDTH 	64	  
  						  
//========移植的时候，根据引脚分配进行修改==========

#define OLED_RST_GPIO_PIN		32
#define OLED_DC_GPIO_PIN		33

//CS
#define OLED_CS_Clr()  //NOT USE
#define OLED_CS_Set()  //NOT USE

//RES
#define OLED_RST_Clr() SetValue(OLED_RST_GPIO_PIN,0)//RES RES => 接RES（RST）引脚
#define OLED_RST_Set() SetValue(OLED_RST_GPIO_PIN,1)

//DC
#define OLED_DC_Clr() SetValue(OLED_DC_GPIO_PIN,0)
#define OLED_DC_Set() SetValue(OLED_DC_GPIO_PIN,1)

     
#define OLED_CMD  0	//写命令
#define OLED_DATA 1	//写数据


//OLED控制用函数
void OLED_WR_Byte(unsigned char dat,unsigned char cmd);	    
void OLED_Display_On(void);
void OLED_Display_Off(void);	   							   		    
void OLED_Init(void);
void OLED_Deinit(void);
void OLED_Clear(void);
void OLED_ShowChar(unsigned char x,unsigned char y,unsigned char chr);
void OLED_ShowNum(unsigned char x,unsigned char y,unsigned long num,unsigned char len,unsigned char size);
void OLED_ShowString(unsigned char x,unsigned char y, unsigned char *p);	 
void OLED_Set_Pos(unsigned char x, unsigned char y);
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]);
#endif  
	 




